<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var obj = {
        name: 'zs',
        car: {
          color: '蓝色',
          brand: '宝马',
          buy: new Date(),
          reg: /\d{5}/,
          num: NaN,
          say: function () {
            console.log('你好')
          },
        },
      }
      // JSON的转换，对象 数组
      // 有些类型不可逆的  时间  正则  NaN 函数  undefined null
      const obj1 = JSON.parse(JSON.stringify(obj))
      // obj.car.color = '红色'
      console.log(obj)
      console.log(obj1)
    </script>
  </body>
</html>
